package com.whacos.modules.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.whacos.common.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @author xiongdun
 * @description 系统用户
 * @since 2018/11/17 17:11
 */
@TableName(value = "t_sys_user")
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class SysUser extends BaseEntity {
    private static final long serialVersionUID = 2562229852698229877L;

    // 用户名
    private String username;
    // 用户真实姓名
    private String realName;
    // 密码
    private String password;
    // 部门
    private Long deptId;
    @TableField(exist = false)
    private String deptName;
    // 邮箱
    private String email;
    // 手机号
    private String mobilePhone;
    // 状态 0:禁用，1:正常
    private Integer status;
    //角色
    @TableField(exist = false)
    private List<Long> roleIds;

    // 身份证号码
    private String idCard;

    //性别
    private Long gender;
    //出身日期
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birth;
    //头像图片ID
    private Long avatarId;
    //现居住地
    private String workAddress;
    //爱好
    private String hobby;
    //省份
    private String province;
    //所在城市
    private String city;
    //所在地区
    private String district;

    public SysUser(Long id) {
        super(id);
    }
}
